# -*- coding: utf-8 -*-
# @Time    : 2024/8/29 0:34
# @Author  : Alvin
# @File    : error_code.py


from app.libs.error import APIException


class Success(APIException):
    code = 201
    msg = 'ok'
    error_code = 0


class ParameterException(APIException):
    code = 400
    msg = 'invalid parameter'
    error_code = 1000


class NotFound(APIException):
    code = 404
    msg = "未找到相关资源"
    error_code = 1001


class ServerError(APIException):
    code = 500
    msg = 'sorry, we made a mistake (*￣︶￣)!'
    error_code = 999


class AuthFailed(APIException):
    code = 401
    msg = '鉴权失败'
    error_code = 1005


class Forbidden(APIException):
    code = 403
    error_code = 1004
    msg = 'forbidden, not in scope'


class RequestFailed(APIException):
    code = 500
    error_code = 1006
    msg = '内部请求错误'

class DataBaseError(APIException):
    code = 500
    error_code = 1100
    msg = '数据库错误'

class MinioError(APIException):
    code = 500
    error_code = 1200
    msg = 'minio存取服务异常'

class ResourceOperationError(APIException):
    code = 500
    error_code = 1300
    msg = '资源操作异常'
